<%@ taglib uri="/WEB-INF/tld/struts-html.tld"   prefix="html"%>
<%@page import="java.util.Collection,java.util.Iterator,org.tigris.atlas.quizme.bizobj.QuizTopicBO,org.tigris.atlas.quizme.client.utils.Constants"%>

<div class="tab-page">
		<div id="subPages" class="disabled link-row">
			<table class="wide-table">
				<tr>
					<td width="780"  height="10">
							<H2>Add Question</H2>
					</td>
				</tr>
			</table>
		</div>
		&nbsp;Enter your question information below:
	<table cellpadding="0" cellspacing="0" border="0">
	<tr>
   <td colspan="2">
   		
	    <fieldset class="documentSection">
			<legend title="User Information" class="documentSection">
		          	Question information
	        </legend>

        	<div id="Information" class="documentSection" title="User information">
        	<html:form action="/addQuestion">
		<table cellpadding="0" cellspacing="0" border="0">
	        <tr>
                   <td valign="top">
	              <table  border="0">
	               <%
 					  	Collection topics = (Collection)request.getSession().getAttribute(Constants.ALL_TOPICS_KEY);
 					  	if(topics != null){
 					  		Iterator i = topics.iterator();
 					 %>
	               <tr>  
	                 <td>
                           <label for="8"><font size="2">Quiz Topic:</font></label>

	                 </td>
 					<td>
 					  
              	      <html:select property="quizTopicId">
              	      		<%
              	      			while(i.hasNext()){
              	      				QuizTopicBO topic = (QuizTopicBO)i.next();
              	      		%>
							<html:option value="<%=topic.getTopicId()%>"><%=topic.getTopicName()%></html:option>
							<% } %>
						</html:select>
	                 </td>
                      </tr>
                      <% } %>
              	      <tr>
	                 <td>
                           <label for="8"><font size="2">Question Text:</font></label>
	                 </td>
	                 <td>
		             	<html:text property="questionQuestion" size="80"/>
	                 </td>
                      </tr>
		      		<tr>
		                 <td>
	                             <label for="10"><font size="2">Multi-Answer?:</label>
		                 </td>
	                	 <td>
		            		<html:checkbox property="questionMultiAnswer"/>
                         </td>
                     </tr>
                     <tr>
		                 <td colspan="2">
	                             <label for="10"><font size="4"><B>Answers:</B></font></label>
		                 </td>
                     </tr>
                     <tr>
		                 <td>
	                            <label for="8"><font size="2">Answer 1:</label>
		                 </td>
		                 <td>
			                 <html:text property="answer1Text" size="20"/> Correct? <html:checkbox property="answer1Correct"/>
		                 </td>
                      </tr>
                      <tr>
		                 <td>
	                            <label for="8"><font size="2">Answer 2:</label>
		                 </td>
		                 <td>
			                 <html:text property="answer2Text" size="20"/> Correct? <html:checkbox property="answer2Correct"/>
		                 </td>
                      </tr>
                      <tr>
		                 <td>
	                            <label for="8"><font size="2">Answer 3:</label>
		                 </td>
		                 <td>
			                 <html:text property="answer3Text" size="20"/> Correct? <html:checkbox property="answer3Correct"/>
		                 </td>
                      </tr>
                      <tr>
		                 <td>
	                            <label for="8"><font size="2">Answer 4:</label>
		                 </td>
		                 <td>
			                 <html:text property="answer4Text" size="20"/> Correct? <html:checkbox property="answer4Correct"/>
		                 </td>
                      </tr>
                      <tr>
		                 <td>
	                            <label for="8"><font size="2">Answer 5:</label>
		                 </td>
		                 <td>
			                 <html:text property="answer5Text" size="20"/> Correct? <html:checkbox property="answer5Correct"/>
		                 </td>
                      </tr>
                      <tr>
		                 <td>
	                            <label for="8"><font size="2">Answer 6:</label>
		                 </td>
		                 <td>
			                 <html:text property="answer6Text" size="20"/> Correct? <html:checkbox property="answer6Correct"/>
		                 </td>
                      </tr>
                      <tr>
		                 <td>
	                            <label for="8"><font size="2">Answer 7:</label>
		                 </td>
		                 <td>
			                 <html:text property="answer7Text" size="20"/> Correct? <html:checkbox property="answer7Correct"/>
		                 </td>
                      </tr>
                      <tr>
		                 <td>
	                            <label for="8"><font size="2">Answer 8:</label>
		                 </td>
		                 <td>
			                 <html:text property="answer8Text" size="20"/> Correct? <html:checkbox property="answer8Correct"/>
		                 </td>
                      </tr>
                            </table>
                            </td>
                            </tr>
                            </table>
                            </html:form>
			</fieldset>

	</div>
<table width="780"  border="0">
		<tr>
			<td colspan="2">&nbsp;
				<button name="save" id="5" enabledMode="" accesskey="S"
					class="imageButton" type="button"
					onclick="javascript:document.QuestionForm.submit()" onmouseout="javascript:className='imageButton';" onmouseover="javascript:className='activeImageButton';" >
					<IMG src="<html:rewrite page='/images/save.gif'/>" alt="Register"><IMG src="<html:rewrite page='/images/space.gif'/>" height="20" width="1">
					<span class="underline">S</span>ave
				</button>
			</td>
		</tr>
	</table>
<BR>